@extends('layouts.app')

@section('title')

@section('styles')
    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <!-- Google Webfont -->
    <!--<link href='http://fonts.useso.com/css?family=Lato:300,400|Crimson+Text' rel='stylesheet' type='text/css'>-->
    <!-- Themify Icons -->
    <link rel="stylesheet" href="/static/css/themify-icons.css" />
    <!-- Bootstrap -->
    <link rel="stylesheet" href="/static/css/bootstrap.css" />
    <!-- Owl Carousel -->
    <link rel="stylesheet" href="/static/css/owl.carousel.min.css" />
    <link rel="stylesheet" href="/static/css/owl.theme.default.min.css" />
    <!-- Magnific Popup -->
    <link rel="stylesheet" href="/static/css/magnific-popup.css" />
    <!-- Superfish -->
    <link rel="stylesheet" href="/static/css/superfish.css" />
    <!-- Easy Responsive Tabs -->
    <link rel="stylesheet" href="/static/css/easy-responsive-tabs.css" />
    <link rel="stylesheet" href="/static/css/course_style.css" />
    <!-- jQuery -->
    <script src="/static/js/jquery-1.10.2.min.js"></script>
    <!-- Theme Style -->
    <link rel="stylesheet" href="/static/css/style.css" />


    <link href="/product/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="/product/style.css" rel="stylesheet" type="text/css" />

@stop

@section('content')

    <style>
        .address-info dd .input{
            height: 30px;
        }
        .express li{
            height: 50px!important;
        }
        #fh5co-header-section{
            position: static!important;
            background: #fffff5;
        }
        #site-nav{
            display: flex!important;
            margin: 0 auto!important;
            height: 30px!important;
            width: 1170px!important;
            padding:0 50px 0 22px!important;
        }
        #site-nav a{
            color: #28bbf8;
            font-size: 12px;
        }
        .ml-auto {
            margin-left: auto!important;
        }
        #fh5co-primary-menu li>a{
            color: #777777;
        }
        #buyButton .add{
            color: #fff!important;
            font-size: 16px;
            line-height: 38px;
            background: #f40!important;
            border: 1px solid #f40!important;
            border-radius: 2px;
            cursor: pointer!important;
        }
    </style>
    <div class="" style="height:100px;"></div>

    <div class="section clearfix">
        <div class="cart-box">
            <h1>确认订单信息</h1>
            <div class="cart-step">
                <ul>
                    <li class="item">
                        <span>1</span>放进购物车</li>
                    <li class="selected">
                        <span>2</span>填写订单信息</li>
                    <li class="last">
                        <span>3</span>支付/确定订单</li></ul>
            </div>
        </div>
        <div class="line30"></div>

        @if (count($errors) > 0)
            <div class="alert alert-danger">
                <div class="mt-2"><b>有错误发生：</b></div>
                <ul class="mt-2 mb-2">
                    @foreach ($errors->all() as $error)
                        <li><i class="glyphicon glyphicon-remove"></i> {{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif


        <h3 class="bar-tit">1、用户信息</h3>
        <form action="{{ route('order.update', $order->no) }}" method="POST">
            {{ method_field('PUT') }}
            @csrf
            <div class="form-box address-info">
                <dl>
                    <dt>用户姓名：</dt>
                    <dd>
                        <input name="accept_name" id="accept_name" type="text" class="input txt wide" readonly="readonly"
                               value="{{ Auth::user()->username }}">
                        <span class="Validform_checktip Validform_right"></span>
                    </dd>
                </dl>
{{--                <!-- <dl>--}}
{{--                <dt>所属地区：</dt>--}}
{{--                <dd>--}}
{{--                <select id="province" name="province" class="select"></select>--}}
{{--                <select id="city" name="city" class="select"></select>--}}
{{--                <select id="area" name="area" class="select" datatype="*" sucmsg=" "></select>--}}
{{--                <span class="Validform_checktip">*请选择您所在的地区</span></dd>--}}
{{--                </dl>-->--}}
                <dl>
                    <dt>手机号码：</dt>
                    <dd>
                        <input name="book_id" id="book_id" type="hidden" value="0">
                        <input name="mobile" id="mobile" type="text" class="input txt" readonly="readonly" value="{{ Auth::user()->phone }}"
                               datatype="m" sucmsg="">
                        <span class="Validform_checktip Validform_right"></span>
                    </dd>
                </dl>
{{--                <dl>--}}
{{--                    <dt>电子邮箱：</dt>--}}
{{--                    <dd>--}}
{{--                        <input name="email" id="email" type="text" class="input txt" readonly="readonly" value="f369852@qq.com" datatype="e" sucmsg=" ">--}}
{{--                        <span class="Validform_checktip Validform_right"></span>--}}
{{--                    </dd>--}}
{{--                </dl>--}}
                <dl>
                    <dt>
                        <b>绑定交易账户：</b>
                    </dt>
                    <dd>
                        <input name="trade_account" id="trade_account" type="text" class="input txt Validform_error"
                               value="{{ $order->trade_account ?? old('trade_account') }}"
                               datatype="*5-100" sucmsg=" " style="background:#fff6ea" nullmsg="请填写信息！">
                        <span class="Validform_checktip Validform_wrong">请填写信息！</span></dd>
                </dl>
{{--                <!--dl>--}}
{{--                <dt>邮政编码：</dt>--}}
{{--                <dd>--}}
{{--                <input name="post_code" id="post_code" type="txt" class="input txt" />--}}
{{--                <span class="Validform_checktip">所在地区的邮政编码，非必填</span></dd>--}}
{{--                </!--dl>-->--}}
            </div>
            <div class="line30"></div>
{{--            <h3 class="bar-tit">2、支付方式</h3>--}}
{{--            <ul class="payment" id="payment">--}}
{{--                <!--取得一个DataTable-->--}}
{{--                <li class="selected" value="2">--}}
{{--                    <label>--}}
{{--                        <input name="payment_id" type="radio" onclick="paymentAmountTotal(this);" value="2" datatype="*" sucmsg=" ">--}}
{{--                        <input name="payment_price" type="hidden" value="0.00">账户余额--}}
{{--                        <em>手续费：0.00元</em>--}}
{{--                        <span class="Validform_checktip Validform_right"></span>--}}
{{--                    </label>--}}
{{--                </li>--}}
{{--            </ul>--}}
            <div class="line30"></div>
            <h3 class="bar-tit">2、配送方式</h3>
            <ul class="express" id="express">
                <!--取得一个DataTable-->
                <li class="selected" value="2">
                    <label>
                        <input name="express_id" type="radio" onclick="freightAmountTotal(this);" checked value="2" datatype="*" sucmsg=" ">
                        <input name="express_price" type="hidden" value="0.00">系统自动发送
                        <em>费用：0.00元</em>
                        <span class="Validform_checktip"></span>
                    </label>
                </li>
            </ul>
            <div class="line30"></div>
            <h3 class="bar-tit">3、商品清单</h3>
            <table class="cart-table" width="100%" cellspacing="0" cellpadding="8" border="0" align="center">
                <tbody>
                <tr>
                    <th colspan="2" align="left">商品信息</th>
                    <th width="84" align="left">单价</th>
                    <th width="84" align="left">优惠(元)</th>
                    <th width="84" align="center">数量</th>
                    <th width="104" align="left">金额(元)</th>
                    <th width="84" align="center">库存(件)</th></tr>
                <tr>
                    <td width="68">
                        <a target="_blank" href="{{ route('product.show', $order->items[0]->product->id) }}">
                            <img src="{{ '/uploads/'.$order->items[0]->product->image }}" class="img"></a>
                    </td>
                    <td>
                        <a target="_blank" href="{{ route('product.show', $order->items[0]->product->id) }}">{{ $order->items[0]->product->title }}</a>
                        <p class="stxt">使用期限：{{ $order->items[0]->productSku['title'] }}</p></td>
                    <td>
                        <span class="red">￥{{ $order->items[0]->productSku->price }}</span></td>
                    <td>
                        <span class="red">￥0.00</span></td>
                    <td align="center">{{ $order->items[0]->amount }}</td>
                    <td>
                        <span class="red">￥{{ $order->total_amount }}</span></td>
                    <td align="center">{{ $order->items[0]->productSku['stock'] }}</td></tr>
                </tbody>
            </table>
            <div class="line30"></div>
            <h3 class="bar-tit">4、结算信息</h3>
            <div class="buy-foot">
                <div class="left">
{{--                    <!--dl>--}}
{{--                    <dd>--}}
{{--                    <label><input name="is_invoice" id="is_invoice" type="checkbox" value="1" onclick="taxAmoutTotal(this);" /> 是否开具发票</label>--}}
{{--                    <input name="taxAmout" id="taxAmout" type="hidden" value="80.00" /></dd>--}}
{{--                    </!--dl>--}}
{{--                    <dl id="invoiceBox" style="display:none;">--}}
{{--                    <dt>发票抬头(100字符以内)</dt>--}}
{{--                    <dd>--}}
{{--                    <input name="invoice_title" id="invoice_title" type="text" class="input" /></dd>--}}
{{--                    </dl>-->--}}
{{--                    <dl>--}}
{{--                        <dt>订单备注(100字符以内)</dt>--}}
{{--                        <dd>--}}
{{--                            <textarea name="message" class="input" style="height:35px;"></textarea>--}}
{{--                        </dd>--}}
{{--                    </dl>--}}
                </div>
                <div class="right">
                    <p>
                        <input type="hidden" id="real_amount" value="2000.00">商品
                        <label class="price">{{ $order->items[0]->amount }}</label>件&nbsp;&nbsp;&nbsp;&nbsp;
                        <!--积分变化：<label class="price">0</label> 分-->商品金额：￥
                        <label id="goodsAmount" class="price">{{ $order->total_amount }}</label>元
                        <!--消费积分：<label id="goodsSellPoint" class="price">0</label>--></p>
{{--                    <p>可用积分：--}}
{{--                        <label class="price" id="pointBalance">0</label>&nbsp;&nbsp;&nbsp;&nbsp;使用积分：--}}
{{--                        <input class="input" type="text" name="paymentPoint" id="paymentPoint" value="0" onchange="orderAmountTotal()" style="width:100px;height:15px;border:2px solid #3b3b3b;" onkeyup="this.value=this.value.replace(/\D/g,'')" onpaste="this.value=this.value.replace(/\D/g,'0')">&nbsp;&nbsp;抵现：￥--}}
{{--                        <label class="price" id="exchangeCash">0.00</label>元</p>--}}
{{--                    <!--p>--}}
{{--                    运费：￥<label id="expressFee" class="price">0.00</label> 元 +--}}
{{--                    支付手续费：￥<label id="paymentFee" class="price">0.00</label> 元 +--}}
{{--                    税费：￥<label id="taxesFee" class="price">0.00</label> 元--}}
{{--                    </p>-->--}}
                    <p class="txt-box">应付总金额：￥
                        <label id="totalAmount" class="price">{{ $order->total_amount }}</label>
                    </p>
{{--                    <!--<p class="txt-box">--}}
{{--                    消费积分：<label id="totalSellPoint" class="price">0</label></p>-->--}}
                    <p class="btn-box">
                        <a class="btn" href="#" style="visibility:hidden;">返回购物车</a>
                        <input name="btnSubmit" type="submit" value="确认提交" class="btn btn-success">
                    </p>
                </div>
            </div>
            <div class="clear" style="height:10px;"></div>
        </form>
    </div>
@stop


@section('scripts')
    <script>

    </script>
@stop
